package com.imooc.controller;

import com.imooc.service.StuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author : Kyle_Fu
 * @Date: 2020-06-06 23:15
 */

@RestController
public class StuFooController {

    @Autowired
    private StuService stuService;

    @GetMapping("/getStu")
    public Object getStu(int id){

        return stuService.getStuInfo(id);

    }

    @PostMapping("/saveStu")
    public Object saveStu(int id){
        stuService.saveStu();
        return "OK";

    }

    @PostMapping("/updateStu")
    public Object updateStu(int id){
        stuService.updataStu(id);
        return "OK";

    }

    @PostMapping("/deleteStu")
    public Object deleteStu(int id){
        stuService.deleteStu(id);
        return "OK";

    }
}
